<?php
require_once("connection.php");



         class guset{
		
    protected $fname ;
       protected   $lname ;
	 protected $address ;
	 protected $city;
	
	public function CreateOrder (){}
	public function cancelOrder (){}
	public function makeReport (){}
	public function Search (){}
	public function updateOrder (){}
	
	}
class RegistedUser extends guset  {
	private $password;
	private $phone;
	private $E_mail ;
	private $gender ;
	private $image;
	private $year , $month ,$day;
	private $date ;
	function register($fname,$lname,$password,$E_mail,$image,$gender,$city,$phone,$address,$year,$month,$day){
	
			
			$this->fname=mysql_real_escape_string($fname);
                        $this->lname=mysql_real_escape_string($lname);
			$this->password=mysql_real_escape_string($password);
			$this->E_mail=mysql_real_escape_string($E_mail);
                        $this->address=mysql_real_escape_string($address);
                        $this->image=$image ;
                        $this->gender=$gender ;
                        $this->city=$city ;
                        $this->phone=$phone ;
                        $this->year= $year ;
                        $this->month= $month ;
                        $this->day= $day ;
                        //$safecity=mysql_real_escape_string($city);
			$q=" INSERT INTO user SET
			    fname='".$this->fname."',
                            lname='".$this->lname."',
		        password='".($this->password)."',
		        email='".$this->E_mail."',
                         image='".$this->image."',
                         gender='".$this->gender."',
                          address='".$this->address."',
		        phone='".$this->phone."',
                        city='".$this->city."',
                      
                          year='".$this->year."',
                                month ='".$this->month."',  
                                 day ='".$this->day."' ,
				signup_date = now()
                               
				";
				$r=mysql_query($q); 
				if($r){
					echo '<h3 style="color:#606 ;">registration Done :)</h2>' ;
					}
					else{
						echo 'error' ;
						echo mysql_error();
						}
						

			} // end of register function
               
/*class users  {
	
	
	function LogIn($userName , $password){
		
	$safeName=mysql_real_escape_string($userName);
	$safePass=mysql_real_escape_string($password);
	$q= " SELECT * FROM users WHERE
		   name = '".$safeName."' AND  
		   password = '".$safePass."'
	";
	$r=mysql_query($q);
		if (mysql_num_rows($r) > 0){
	$user = mysql_fetch_array($r);
		$_SESSION['userLogged'] = 1;
		$_SESSION['userID'] = $user['id'];
		$_SESSION['userName'] =$user['name'];
		$_SESSION['userDate'] = $user['signup_date'] ;
		$_SESSION['userImage'] = $user['image'] ;
		$_SESSION['userMail'] = $user['E_mail'] ;
		$_SESSION['userCountry'] = $user['country'] ;
		$_SESSION['userId'] = $user['id'] ;
		$_SESSION['userGender'] = $user['gender'] ;
		}
		else{
			$_SESSION['login_error'] = "please try again !! " ;
			header ("location: index.php");
			}
			
		}
	
		
		
		function register($userName,$password,$E_mail,$image,$gender,$country){
	
			
			$safeName=mysql_real_escape_string($userName);
			$safePass=mysql_real_escape_string($password);
			$safeEmail=mysql_real_escape_string($E_mail);
			$q=" INSERT INTO users SET
			    name='".$safeName."',
				password='".$safePass."',
				E_mail='".$safeEmail."',
				image='".$image."',
				gender='".$gender."',
				country='".$country."',
				signup_date = now()
				";
				$r=mysql_query($q); 
				if($r){
					echo '<h3 style="color:#606 ;">registration Done :)</h2>' ;
					}
					else{
						echo 'error' ;
						echo mysql_error();
						}
						

			}
                        
              function LogOut(){
			session_destroy();
			header ("location: index.php");
			}	
                        
                        
                       
	
	};*/
	
	
	

};
                
                



?>
